package com.example.demo.controller;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "测试管理", tags = {"测试"})
@RestController
@RequestMapping("/view")
@Slf4j
public class ViewController {

    /**
     * jsonp 解决跨域
     * @return
     */
//    @GetMapping("html/get")
//    public String index(){
//        JSONObject json = new JSONObject();
//        String result = "html >>19222>>>";
//        json.put("result",result);
//        System.out.println("html >>19222>>>");
//        return "successCallback("+json.toJSONString()+")";
//    }

//    @CrossOrigin
    @GetMapping("html/get")
    public String index(){
        JSONObject json = new JSONObject();
        String result = "html >>19333>>>";
        json.put("result",result);
        System.out.println("html >>19333>>>");
        return json.toJSONString();
    }
}
